import * as React from "react";
import style from "./style.module.css";
import { Link } from "react-router-dom";
import { IRecruit } from "../../types";
import * as Enum from "../../assets/enum";

interface Props {
  information: IRecruit | undefined;
}

// 职位详细信息页面 职位简介组件
export default function RecruitIntroduce(props: Props) {
  return (
    <div className={style.banner}>
      <div className={style.jobname}>
        <div className={style.title}>{props.information?.positionName}</div>
        <div className={style.salary}>
          {props.information?.salary.min}-{props.information?.salary.max}k
        </div>
      </div>
      <p>
        <Link to="/" className={style.city}>
          {props.information?.city}
        </Link>
        <em className={style.vline}></em>
        {Enum.toYear(props.information?.workYear)}
        <em className={style.vline}></em>
        {Enum.toEducation(props.information?.education)}
      </p>
      <div className={style.keys}>
        {props.information?.keyWords.map((item, index) => {
          return <span key={index}>{item}</span>;
        })}
      </div>
      <div className={style.time}>更新于：{props.information?.updatedAt}</div>
    </div>
  );
}
